package com.etc.web;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

/**
 * 主页页面控制器
 */
@Controller
@RequestMapping(value = "/index")
public class jumpControler {

    //主页
    @RequestMapping(value = "")
    public ModelAndView index(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/index");
        return view ;
    }
    //测试
    @RequestMapping(value = "/text")
    public ModelAndView text(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/text1");
        return view ;
    }

    //注册
    @RequestMapping(value = "/jump/register")
    public ModelAndView register(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/modelFunction/SelectIdentif");
        return view ;
    }
    //注册学生界面
    @RequestMapping(value = "/jump/register/student")
    public ModelAndView registerStu(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/modelFunction/StudentRegister");
        return view ;
    }

    //注册老师界面
    @RequestMapping(value = "/jump/register/teacher")
    public ModelAndView registerTea(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/modelFunction/TeacherRegister");
        return view ;
    }
    //登录界面
    @RequestMapping(value = "/jump/login")
    public ModelAndView login(){
        ModelAndView view = new ModelAndView();
        view.setViewName("modelFunction/Login");
        return view;
    }
    //退出登录
    @RequestMapping(value = "/jump/exit")
    public String exit(HttpSession httpSession){
        httpSession.removeAttribute("username");
        return "redirect:/index";
    }


}
